from sqlalchemy import Table, Date, Column, Integer, String, ForeignKey
from sqlalchemy.orm import registry
mapper_registry = registry()
Base = mapper_registry.generate_base()

class Jobs_companies_r(Base):
    __tablename__ = "jobs_companies_r"
    jc_id = Column(String(32), primary_key=True)
    cp_id = Column(String(32) )
    j_id = Column(String(32))

    def __init__(self,jc_id=None,cp_id=None,j_id=None,):
        self.jc_id = jc_id
        self.cp_id = cp_id
        self.j_id = j_id
        self._job=None
        self._company=None


    def format_str(self):
        return self.cp_id+","+self.j_id+","+self._job.j_name+","+self._company.cp_name+","+self._company.address





